package cn.com.dhcc.ddi.task.vo.wapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.com.dhcc.app.core.handler.dbhandler.WappedResultSet;
import cn.com.dhcc.ddi.task.vo.TaskExecuteLog;

public class TaskLogRowWapper implements RowMapper<TaskExecuteLog>{

	@Override
	public TaskExecuteLog mapRow(ResultSet rss, int rowNum) throws SQLException {
		WappedResultSet rs = new WappedResultSet(rss);
		TaskExecuteLog vo = new TaskExecuteLog();
		
		vo.setLinkDataFilePath(rs.getString("LINK_DATA_FILE_PATH"));
		vo.setGroupId(rs.getString("group_id"));
		vo.setId(rs.getString("ID"));
		vo.setLinkEndTime(rs.getTimestamp("LINKENDTIME"));
		vo.setLinkStartTime(rs.getTimestamp("LINKSTARTTIME"));
		vo.setLinkSummary(rs.getString("LINKSUMMARY"));
		vo.setLinkType(rs.getString("LINKTYPE"));
		vo.setLogMsg(rs.getString("LOG_MSG"));
		vo.setMtime(rs.getTimestamp("MTIME"));
		vo.setLogStatus(rs.getString("LOG_STATUS"));
		vo.setTaskId(rs.getString("TASK_ID"));
		vo.setErrorNum(rs.getInteger("errorNum")==null ? 0:rs.getInteger("errorNum"));
		vo.setTotal(rs.getInteger("total")==null ? 0:rs.getInteger("total"));
		vo.setUpdateNum(rs.getInteger("updateNum")==null ? 0:rs.getInteger("updateNum"));
		vo.setInsertNum(rs.getInteger("insertNum")==null ? 0:rs.getInteger("insertNum"));
		return vo;
	}

}
